<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>顾客管理</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap-theme.min.css">
<script src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrap/js/bootstrap.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrapvaildator/js/bootstrapValidator.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrapvaildator/js/language/zh_CN.js"></script>
</head>
<!-- <body style="margin: 30px;"> -->
<body>
		<center>
			<form action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_custom_user1" method="post" name="myform" id="myform">
				<table>
					<tr align="center">
						<td align="right">
							<div class="form-group">
								<label for="mobile">账号：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="mobile" name="mobile" value="${mobile }" >
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="username">姓名：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="username" name="username" value="${username }">
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="born_date">生日：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="date" class="form-control" name="born_date" id="born_date" value="<f:formatDate value='${born_date }' pattern='yyyy-MM-dd'/>">
							</div>
						</td>
						<!-- 表单按钮组 -->
						<td rowspan="2">
							<button class="btn btn-primary btn-sm" type="submit" name="zjjinquiry" id="zjjinquiry">
								<span class="glyphicon glyphicon-search" aria-hidden="true"></span>&nbsp;&nbsp;查询
							</button> &nbsp;&nbsp;
							<button class="btn btn-primary btn-sm" type="button" name="zjjresetting" id="zjjresetting">
								<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;&nbsp;重置
							</button>
						</td>
					</tr>
					<tr align="center">
						<td align="right">
							<div class="form-group">
								<label for="beauty_num">颜值：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<select class="form-control" name="beauty_num" id="beauty_num">
									<option value="" selected="selected">请选择~！</option>
									<option value="1">有</option>
									<option value="2">无</option>
								</select>
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="buy_num">礼包：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<select class="form-control" name="buy_num" id="buy_num">
									<option value="" selected="selected">请选择~！</option>
									<option value="1">有</option>
									<option value="2">无</option>
								</select>
							</div>
						</td>
						<!-- <td align="right">
							<div class="form-group">
								<label for="entry_date">时间分类：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<select class="form-control" name="entry_date" id="entry_date">
									<option value="" selected="selected">请选择~！</option>
									<option value="1">一个月未到店</option>
									<option value="2">两个月未到店</option>
									<option value="3">三个月未到店</option>
									<option value="4">半年未到店</option>
									<option value="5">一年未到店</option>
								</select>
							</div>
						</td> -->
					</tr>
				</table>
			</form>
			<table class="table table-bordered table-condensed table-hover">
				<tr align="center">
					<td></td>
					<td>头像</td>
					<td>会员号</td>
					<td>账号</td>
					<td>姓名</td>
					<td>昵称</td>
					<td>性别</td>
					<td>生日</td>
					<td>持有颜值</td>
					<td>礼包</td>
					<td>最近到店时间</td>
					<td>操作</td>
				</tr>
				<c:forEach items="${info.list }" var="list" varStatus="s">
					<tr align="center">
						<td>${s.index+1 }</td>
						<td><img src="/bsc${list.photo }" width="120px" height="100px"/></td>
						<td>${list.custom_user_id }</td>
						<td>${list.mobile }</td>
						<td>${list.username }</td>
						<td>${list.nikename }</td>
						<%-- <td>${list.sex }</td> --%>
						<td>
							<c:if test="${list.sex==1 }">
								男
							</c:if>
							<c:if test="${list.sex==2 }">
								女
							</c:if>
							<c:if test="${list.sex==3 }">
								保密
							</c:if>
						</td>
						<%-- <td>${list.born_date }</td> --%>
						<td><f:formatDate value="${list.born_date }" pattern="yyyy-MM-dd" /></td>
						<td>${list.beauty_num }</td>
						<td>${list.buy_num }</td>
						<%-- <td>${list.recent_time }</td> --%>
						<td><f:formatDate value="${list.recent_time }" pattern="yyyy-MM-dd" /></td>
						<td>
							<a href="${pageContext.request.contextPath }/proltal/zjj1/findByIdBis_custom_user1/${list.custom_user_id}">
								<button type="button" class="btn btn-primary btn-xs">查看资料</button>
							</a>
							<%-- <a href="${pageContext.request.contextPath }/proltal/zjj1/findByIdBis_custom_user2/${list.custom_user_id}"> --%>
							<a href="${pageContext.request.contextPath }/proltal/zjj1/findByIdBis_custom_user2?custom_user_id=${list.custom_user_id}">
								<button type="button" class="btn btn-primary btn-xs">消费情况</button>
							</a>
						</td>
					</tr>
				</c:forEach>
			</table>

			<!-- 分页 -->
			<a href="#" onclick="first()">首页</a> &nbsp;&nbsp;&nbsp;
			<a href="#" onclick="pre()">上一页</a> &nbsp;&nbsp;&nbsp;
			<a href="#" onclick="next()">下一页</a> &nbsp;&nbsp;&nbsp;
			<a href="#" onclick="last()">尾页</a>
		</center>
</body>
</html>
<script type="text/javascript">
	//条件查询定值方法
	$(function(){
		$("#beauty_num").val('${beauty_num}');
		$("#buy_num").val('${buy_num}');
	})

	//分页
	//首页
	function first(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_custom_user1?page=${info.firstPage}";
		document.forms[0].submit();lase
	}
	//上一页
	function pre(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_custom_user1?page=${info.prePage}";
		document.forms[0].submit();
	}
	//下一页
	function next(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_custom_user1?page=${info.nextPage}";
		document.forms[0].submit();
	}
	//尾页
	function last(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_custom_user1?page=${info.lastPage}";
		document.forms[0].submit();
	}
	
	//点击重置按钮 重置
	$("#zjjresetting").click(
		function() {
			$("#mobile").val("");
			$("#username").val("");
			$("#born_date").val("");
			$("#beauty_num").val("");
			$("#buy_num").val("");
		}
	);
</script>